home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
midiplay
/
mci1.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
6KB
|
278 lines
VERSION 2.00
Begin Form Form1
BackColor = &H00C0C0C0&
Caption = "Playing Midi files in the Background"
ClientHeight = 4800
ClientLeft = 1275
ClientTop = 1365
ClientWidth = 7290
ClipControls = 0 'False
Height = 5490
Icon = MCI1.FRX:0000
Left = 1215
LinkTopic = "Form1"
ScaleHeight = 4800
ScaleWidth = 7290
Top = 735
Width = 7410
Begin TextBox Text1
BackColor = &H00FFFF00&
Height = 3615
Left = 720
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 2
Top = 360
Width = 5895
End
Begin CommandButton Command1
Caption = "&Exit"
Height = 495
Left = 240
TabIndex = 1
Top = 4200
Width = 1215
End
Begin PictureBox MMControl1
BackColor = &H000000FF&
Height = 1000
Left = 0
ScaleHeight = 975
ScaleWidth = 975
TabIndex = 0
Top = 0
Width = 1000
End
Begin Menu FileName
Caption = "&File"
Begin Menu ExitName
Caption = "&Exit"
End
End
Begin Menu SoundName
Caption = "&Sound"
Begin Menu NoName
Caption = "&No Sound"
Shortcut = {F11}
End
Begin Menu EnableName
Caption = "&Enable Sound"
End
Begin Menu SkipName
Caption = "&Skip File"
Shortcut = {F9}
End
Begin Menu SeparatorName
Caption = "-"
End
Begin Menu PlayingName
Index = 0
End
End
End
Sub AboutName_Click ()
End Sub
Sub AccessName_Click ()
End Sub
Sub AdName_Click ()
End Sub
Sub AgainName_Click ()
form1.MMControl1.Command = "CLOSE"
form1.MMControl1.FileName = "bumble.mid"
form1.MMControl1.Command = "Open"
form1.MMControl1.Command = "PLAY"
End Sub
Sub ArticleName_Click ()
End Sub
Sub AssemblyName_Click ()
End Sub
Sub BaseName_Click ()
End Sub
Sub BasicName_Click ()
End Sub
Sub BBSNAME_Click ()
End Sub
Sub Command1_Click ()
End
End Sub
Sub Command3D1_Click ()
End Sub
Sub Command3D2_Click ()
End Sub
Sub Command3D3_Click ()
End Sub
Sub Command3D4_Click ()
End Sub
Sub Command3D5_Click ()
End Sub
Sub Command3D6_Click ()
End Sub
Sub Command3D7_Click ()
End
End Sub
Sub ContentsName_Click ()
SendKeys "{F1}"
End Sub
Sub CorelName_Click ()
End Sub
Sub EnableName_Click ()
PlayingName(0).Caption = "Midi file: Ragtime.mid"
SkipName.Enabled = True
NONAME.Enabled = True
EnableName.Enabled = False
i = 0 'reset variable to play file list over again
Midiname = "ragtime.mid"
midi2play
End Sub
Sub ExitName_Click ()
End
End Sub
Sub ExpertName_Click ()
End Sub
Sub Form_Load ()
ChDir app.Path 'change to the directory the application was launched from
ChDrive app.Path 'change to the current drive
i = 0 'initialise variable at 0 - used in midi2play
midiplay 'play the first midi file on load event for form1
On Error GoTo FileError
Open "midi.txt" For Input As #1 'open selected text file
Do While Not EOF(1)
form1.Text1.Text = Input$(LOF(1), #1)
Loop
Close #1 'close the text file
Exit Sub
FileError:
MsgBox "Can't find text file"
Exit Sub
End Sub
Sub Form_Unload (Cancel As Integer)
form1.MMControl1.Command = "CLOSE"
End Sub
Sub FoxName_Click ()
End Sub
Sub InfoName_Click ()
End Sub
Sub InformName_Click ()
End Sub
Sub LibraryName_Click ()
End Sub
Sub LotusName_Click ()
End Sub
Sub MapName_Click ()
End Sub
Sub MemberName_Click ()
End Sub
Sub MMControl1_Done (NotifyCode As Integer)
i = i + 1 'increment i each time done event executes to chose different file to play (initialised at 0)
Select Case i
Case 1
Midiname = "Bumble.mid"
PlayingName(0).Caption = "Midi file: " & Midiname
midi2play
Case 2
Midiname = "Furelise.mid"
PlayingName(0).Caption = "Midi file: " & Midiname
midi2play
Case 3
Midiname = "Hoedown.mid"
PlayingName(0).Caption = "Midi file: " & Midiname
midi2play
Case 4
Midiname = "Ragtime.mid"
PlayingName(0).Caption = "Midi file: " & Midiname
midi2play
i = 0 'reset i to 0 to start play cycle over again
Case Else
'no file selected - playing stops
End Select
End Sub
Sub NOName_Click ()
i = 20 'fires case else event in MMControl1 done event -no case 20
form1.MMControl1.Command = "CLOSE"
EnableName.Enabled = True 'set the sound enabled menu to enabled
NONAME.Enabled = False 'set noname sound menu option to disabled
SkipName.Enabled = False 'set skipname sound menu option to disabled
PlayingName(0).Caption = "Midi file: None"
End Sub
Sub OfficersName_Click ()
End Sub
Sub ParadoxName_Click ()
End Sub
Sub ReviewName_Click ()
End Sub
Sub SkipName_Click ()
form1.MMControl1.Command = "Close" 'closes current file, in done event, i increments by 1 to play next file
End Sub
Sub SmartName_Click ()
End Sub
Sub TerminalName_Click ()
Dim X
On Error GoTo DataError
X = Shell("terminal.exe slug.trm", 5)
Exit Sub
DataError:
MsgBox "Can't find 'Terminal.exe'", 48, "St. Louis Users Group"
Exit Sub
End Sub
Sub WindowsName_Click ()
End Sub
Sub WordPerfectName_Click ()
End Sub